Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎬 Add video conversions for avi, mov -> mp4 #1696

Merged
merged 3 commits into from
Dec 10, 2024
Merged

🎬 Add video conversions for avi, mov -> mp4 #1696

merged 3 commits into from
Dec 10, 2024

Conversation

fwkoch
Copy link
Collaborator

@fwkoch fwkoch commented Dec 9, 2024

This PR adds support for avi and mov files if ffmpeg is installed. This plugs in to the existing image conversion logic, so the code changes are quite straightforward.

Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: fc46ce9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
myst-cli Patch
mystmd Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

if (fs.existsSync(output)) {
session.log.debug(`Cached file found for converted ${inputFormatUpper}: ${input}`);
} else {
const ffmpegCommand = `ffmpeg -i ${input} -crf 18 -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" ${output}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I anticipate this executable may need to evolve, if and when we encounter errors converting videos. This was good enough for the mov and avi files I tried, though. 🤷

@fwkoch fwkoch merged commit 416fc41 into main Dec 10, 2024
7 checks passed
@fwkoch fwkoch deleted the feat/ffmpeg branch December 10, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant